<template>
  <div>
    <h2>v-for指令</h2>
    <ul>
      <li v-for="(item, index) in list" :key="item.id">
        {{ index + 1 }} —— {{ item.id }} —— {{ item.name }} ——
        {{ item.nickname }}
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [
        { id: 200, name: "宋江", nickname: "及时雨" },
        { id: 400, name: "吴用", nickname: "智多星" },
        { id: 528, name: "林冲", nickname: "豹子头" },
      ],
    };
  },
};
</script>

<style>
h2 {
  color: skyblue;
}
</style>